#include <QCoreApplication>
#include <iostream>
#include <cmath>
using namespace std;

int main(int argc, char *argv[])
{
    QCoreApplication w(argc, argv);
    double a=0;
    double c=0;
    double h=0;
    double S=0;
    int i;
    cout<<"Viberite element, 1-Katet, 2-Gipotenuza, 3-Visota, 4-Ploshad': ";
    cin>>i;
    cout<<"Vvedite znachenie: ";
    switch (i)
    {
    case 1: cin>>a;cout<<"a= "<<a<<" c= "<<a*sqrt(2)<<" h= "<<c/2<<" S="<<c*h/2;break;
    case 2: cin>>c;cout<<"a= "<<c/sqrt(2)<<" c= "<<c<<" h= "<<((c/sqrt(2))*sqrt(2))/2<<" S="<<c*(((c/sqrt(2))*sqrt(2))/2)/2;break;
    case 3: cin>>h;cout<<"a= "<<2*h/sqrt(2)<<" c= "<<2*h<<" h= "<<h<<" S="<<2*h*h/2;break;
    case 4: cin>>S;cout<<"?";break;
    }
    return w.exec();
}
